Optimal. Leaf size=134 \[ \frac {\tan (c+d x) \left (2 a^2 C+6 a b B+3 A b^2+2 b^2 C\right )}{3 d}+\frac {\left (2 a^2 B+2 a b (2 A+C)+b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+a^2 A x+\frac {b (2 a C+3 b B) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {C \tan (c+d x) (a+b \sec (c+d x))^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {4056, 4048, 3770, 3767, 8} \[ \frac {\tan (c+d x) \left (2 a^2 C+6 a b B+3 A b^2+2 b^2 C\right )}{3 d}+\frac {\left (2 a^2 B+2 a b (2 A+C)+b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+a^2 A x+\frac {b (2 a C+3 b B) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {C \tan (c+d x) (a+b \sec (c+d x))^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 4048
Rule 4056
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {C (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} \int (a+b \sec (c+d x)) \left (3 a A+(3 A b+3 a B+2 b C) \sec (c+d x)+(3 b B+2 a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b (3 b B+2 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{6} \int \left (6 a^2 A+3 \left (2 a^2 B+b^2 B+2 a b (2 A+C)\right ) \sec (c+d x)+2 \left (3 A b^2+6 a b B+2 a^2 C+2 b^2 C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=a^2 A x+\frac {b (3 b B+2 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} \left (3 A b^2+6 a b B+2 a^2 C+2 b^2 C\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (2 a^2 B+b^2 B+2 a b (2 A+C)\right ) \int \sec (c+d x) \, dx\\ &=a^2 A x+\frac {\left (2 a^2 B+b^2 B+2 a b (2 A+C)\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b (3 b B+2 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}-\frac {\left (3 A b^2+6 a b B+2 a^2 C+2 b^2 C\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=a^2 A x+\frac {\left (2 a^2 B+b^2 B+2 a b (2 A+C)\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\left (3 A b^2+6 a b B+2 a^2 C+2 b^2 C\right ) \tan (c+d x)}{3 d}+\frac {b (3 b B+2 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.70, size = 322, normalized size = 2.40 \[ \frac {\sec ^3(c+d x) \left (4 \sin (c+d x) \left (\cos (2 (c+d x)) \left (3 a^2 C+6 a b B+3 A b^2+2 b^2 C\right )+3 a^2 C+3 b (2 a C+b B) \cos (c+d x)+6 a b B+3 A b^2+4 b^2 C\right )+9 \cos (c+d x) \left (-\left (2 a^2 B+2 a b (2 A+C)+b^2 B\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+\left (2 a^2 B+2 a b (2 A+C)+b^2 B\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 a^2 A (c+d x)\right )+3 \cos (3 (c+d x)) \left (-\left (2 a^2 B+2 a b (2 A+C)+b^2 B\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+\left (2 a^2 B+2 a b (2 A+C)+b^2 B\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 a^2 A (c+d x)\right )\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.76, size = 179, normalized size = 1.34 \[ \frac {12 \, A a^{2} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (2 \, B a^{2} + 2 \, {\left (2 \, A + C\right )} a b + B b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (2 \, B a^{2} + 2 \, {\left (2 \, A + C\right )} a b + B b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, C b^{2} + 2 \, {\left (3 \, C a^{2} + 6 \, B a b + {\left (3 \, A + 2 \, C\right )} b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.29, size = 364, normalized size = 2.72 \[ \frac {6 \, {\left (d x + c\right )} A a^{2} + 3 \, {\left (2 \, B a^{2} + 4 \, A a b + 2 \, C a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, B a^{2} + 4 \, A a b + 2 \, C a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.15, size = 225, normalized size = 1.68 \[ a^{2} A x +\frac {A \,a^{2} c}{d}+\frac {B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{2} C \tan \left (d x +c \right )}{d}+\frac {2 A a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {2 B a b \tan \left (d x +c \right )}{d}+\frac {a b C \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {C a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {A \,b^{2} \tan \left (d x +c \right )}{d}+\frac {b^{2} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {b^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 b^{2} C \tan \left (d x +c \right )}{3 d}+\frac {b^{2} C \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.35, size = 207, normalized size = 1.54 \[ \frac {12 \, {\left (d x + c\right )} A a^{2} + 4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C b^{2} - 6 \, C a b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 3 \, B b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, B a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 24 \, A a b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 12 \, C a^{2} \tan \left (d x + c\right ) + 24 \, B a b \tan \left (d x + c\right ) + 12 \, A b^{2} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.91, size = 512, normalized size = 3.82 \[ \frac {\frac {A\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {B\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {C\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {C\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{6}+\frac {A\,b^2\,\sin \left (c+d\,x\right )}{4}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{4}+\frac {C\,b^2\,\sin \left (c+d\,x\right )}{2}+\frac {B\,a\,b\,\sin \left (3\,c+3\,d\,x\right )}{2}+\frac {C\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {3\,A\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {3\,B\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {3\,B\,b^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}+\frac {A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {B\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}+\frac {B\,a\,b\,\sin \left (c+d\,x\right )}{2}+3\,A\,a\,b\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {3\,C\,a\,b\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+A\,a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )+\frac {C\,a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}}{d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________